//
//  UIView+Extension.swift
//  NSinaWeibo
//
//  Created by LoliQueen on 16/2/23.
//  Copyright © 2016年 LoliQueen. All rights reserved.
//

import UIKit

extension UIView {
    
    //遍历响应者链条 获取视图导航控制器
    func navViewController() -> UINavigationController?{
    print("hahaha")
        var next = nextResponder()
        
        while next != nil {
            if let nextObj = next as? UINavigationController{
                print("heihei")
                return nextObj
            }
            next = next?.nextResponder()

        }
        return nil
    }
}
